<%@include file="/WEB-INF/common/taglibs.jsp" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<script src="/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/ckfinder/ckfinder.js"></script>
<script>
$(document).ready(function(){

	CKEDITOR.replace('announcemenContent',{
     		 customConfig: '/ckeditor/cust-config.js'
		
	});
	CKEDITOR.on( 'instanceReady', function( evt ) {
		var editor = evt.editor;
		
		// Apply focus class name.
		editor.on( 'focus', function() {
			editor.container.addClass( 'cke_focused' );
		});
		editor.on( 'blur', function() {
			editor.container.removeClass( 'cke_focused' );
		});

		// Put startup focus on the first editor in tab order.
		if ( editor.tabIndex == 1 ){
			editor.focus();
		}
		CKFinder.setupCKEditor( editor, { basePath : '/ckfinder/', skin : 'v1' } ) ;
});
});	
 
</script>


<div class="row-fluid">
   <div class="span8">
               <div class="well">
                                <div class="page-header center">
                                <div class="box gradient">
								<div class="title">
                                    <h4>Compose Announcement </h4>                             
                                        <button id="send" class="btn btn-info marginR10"><strong>Save</strong></button>
                                        <button id="discard" class="btn marginR10" onclick="javascript:history.back()">Discard</button>
                                    </div>
                                   
                                </div>
                                    
                                </div>
                                <form id="mail" class="form-horizontal" method="post">
                                    <div class="form-row row-fluid">
                                        <div class="span6">
                                            <div class="row-fluid">
                                                <label class="form-label span2">Title:</label>
                                                <input class="span4"   name="title" type="text" value="${announcement.title}"/>
                                             </div>
                                             <div class="row-fluid">
	                                         <label class="form-label span2">Date:</label>
                                                <input class="span4"  id="datepicker-inline" name="createDate" type="text"  value="<fmt:formatDate pattern="yyyy-MM-dd" value="${announcement.createDate}"/>"/>
                                             </div>
                                             
                                        </div>
                                    </div>
                                      <div class="form-row row-fluid">
                                        <div class="span12">
                                            <div class="row-fluid">
                                                <textarea name="content"  class="span12 " id="announcemenContent" rows="8">${announcement.content}</textarea>
                                            </div>
                                        </div>
                                    </div>

                                </form>
                                </div>
                                

                            </div> 
                            </div>
                            
<script>
if($('#datepicker-inline').length) {
	$('#datepicker-inline').datepicker({
        inline: true,
		showOtherMonths:true,
		dateFormat : "yy-mm-dd"
  });
}

  $('#send').click(function(){
	$('#mail').submit();
});
  
  </script>                          